home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / wmail230.zip / WNODE220.ARJ / WNODELST.PAS < prev   
Pascal/Delphi Source File  |  1992-12-28  |  21KB  |  675 lines

  1. Unit WNodelst;
  2. {$O+;$R-}
  3.  
  4. {-----------------------------------------------------------------}
  5. { Window nodelist handler for editors,mailers and mail processors }
  6. { Copyright 1991,92 by Silvan Calarco (2:334/100.2@fidonet.org)   }
  7. {-----------------------------------------------------------------}
  8.  
  9. {============================================================================}
  10. { This unit may be used in your programs and is distributed to favour the    }
  11. { diffusion of an unique nodelist format. The nodelist compiler program is   }
  12. { called WNODE.EXE and is availaible either in the packed that contains      }
  13. { this unit and in SDS network.                                              }
  14. { The structures of W-Nodelist are in file WNSTRUCT.DOC.                     }
  15. {                                                                            }
  16. { HOW TO USE THIS UNIT:                                                      }
  17. { Using W-Nodelist two sort of shearches can be made:                        }
  18. { 1) By Sysop's name with FindFirstSysop and FindNextSysop                   }
  19. { 2) By Node number with FindFirstNode and FindNextNode                      }
  20. {                                                                            }
  21. { Before performing any sort of search, you have to declare a variable       }
  22. { of type FindNodeRec. The filosophy of this method is very similar to       }
  23. { the one used by TP's FindFirst/FindNext procedures, so FindNodeRec has     }
  24. { the same purpose of SearchRec in unit DOS of TP.                           }
  25. { Inquire results will be returned in FindNodeRec.BBSRecord, a record        }
  26. { which contains these informations:                                         }
  27. {                                                                            }
  28. { BBSRecord=Record                                                           }
  29. {              NodeType:Byte;                                                }
  30. {              Zone,Net,Node,Point:Integer;                                  }
  31. {              BBSName:String[30];                                           }
  32. {              SysopName:String[30];                                         }
  33. {              Location:String[30];                                          }
  34. {              Phone:String[18];                                             }
  35. {              BaudRate:Word;                                                }
  36. {              Flags:String[30];                                             }
  37. {           end;                                                             }
  38. {                                                                            }
  39. { NODETYPE contains one of the following values:                             }
  40. {                                                                            }
  41. {  ZC=1; REGION=2; HOST=4; HUB=8; PVT=16; INHOLD=32; DOWN=64; BOSS=128       }
  42. {                                                                            }
  43. { Other fields contents are the image of what appears in nodelist.           }
  44. {                                                                            }
  45. {----------------------------------------------------------------------------}
  46. {                                                                            }
  47. { 1) FindFirstSysop/FindNextSysop                                            }
  48. {                                                                            }
  49. { To look for one or more entries knowing sysop's name call first time:      }
  50. {                                                                            }
  51. { Procedure FindFirstSysop(SubStr:String;Var Find:FindNodeRec);              }
  52. {                                                                            }
  53. { Where SubStr is the case unsensitive match string for sysop's name.        }
  54. { Note that a name like "John Mc Gregor" is converted in "GREGOR MC JOHN"    }
  55. { for search. This means that match string "MC GREGOR" wouldn't return       }
  56. { the desired entry.                                                         }
  57. {                                                                            }
  58. { To continue search use:                                                    }
  59. {                                                                            }
  60. { Procedure FindNextSysop(Var Find:FindNodeRec);                             }
  61. {                                                                            }
  62. { If Find.BBSRecord.SysopName='' it means that there are no more entries.    }
  63. {                                                                            }
  64. {----------------------------------------------------------------------------}
  65. {                                                                            }
  66. { 2) FindFirstNode/FindNextNode                                              }
  67. {                                                                            }
  68. { To look for one or more entries knowing address call first time:           }
  69. {                                                                            }
  70. { Procedure FindFirstNode(Zone,Net,Node,Point:Integer;Var Find:FindNodeRec); }
  71. {                                                                            }
  72. { Where Zone,Net,Node,Point contain the address of the node to look for.     }
  73. { If you want to look for more than one entry, you can assign one of address }
  74. { fields the value of "ALL" constant. E.g.:                                  }
  75. {                                                                            }
  76. { Zone:=ALL                      looks for every node in database            }
  77. { Zone:=2; Net:=334; Node:=ALL   looks for every node in zone 2, net 334     }
  78. {                                                                            }
  79. { To continue search use:                                                    }
  80. {                                                                            }
  81. { Procedure FindNextSysop(Var Find:FindNodeRec);                             }
  82. {                                                                            }
  83. { If Find.BBSRecord.SysopName='' it means that there are no more entries.    }
  84. {                                                                            }
  85. {============================================================================}
  86.  
  87.  
  88. Interface
  89. Const
  90.    { List of kinds of entries specified in BBSRecord.NodeType }
  91.    ZC=1;
  92.    REGION=2;
  93.    HOST=4;
  94.    HUB=8;
  95.    PVT=16;
  96.    INHOLD=32;
  97.    DOWN=64;
  98.    BOSS=128;
  99.    ALL=-1; { Used to select global nodes with FindFirstNode }
  100.    CompileMode:Boolean=False; { Set to TRUE by WNode when compiling }
  101.  
  102. Type
  103.    BBSRec=Record                 { Record containing nodelist informations }
  104.              NodeType:Byte;
  105.              Zone,Net,Node,Point:Integer;
  106.              BBSName:String[30];
  107.              SysopName:String[30];
  108.              Location:String[30];
  109.              Phone:String[18];
  110.              BaudRate:Word;
  111.              Flags:String[30];
  112.           end;
  113.  
  114.    NodeLocRec=Record             { Record of NODELOC.WNL }
  115.                  NodeType:Byte;
  116.                  Zone,Net,Node,Point:Integer;
  117.                  FileNum:Byte;
  118.                  FilePos:Longint;
  119.               end;
  120.    SysopRec=Record               { Record of SYSLIST.WNL }
  121.                Name:String[20];
  122.                BBSRecord:Longint;
  123.             end;
  124.    NodeRec=Record                { Record di NodeIdx.WNL }
  125.               NodeType:Byte;
  126.               Number:Integer;
  127.               BBSRecord:Longint;
  128.               Match:Array[1..4] of Char;
  129.               SysopRecord:Longint;
  130.            end;
  131.  
  132.    FindNodeRec=Record            { Record usato in FindFirstNode/FindFirstSysop }
  133.                   BBSRecord:BBSRec;
  134.                   SZone,SNet,SNode,SPoint:Integer;
  135.                   SysStr:String[30];
  136.                   FPos,FPos1:Longint;
  137.                end;
  138.  
  139. Var
  140.    NodeLocFile:File of NodeLocRec;
  141.    SysopListFile:File of SysopRec;
  142.    NodeIdxFile:File of NodeRec;
  143.    Nodelist1,NodeList2